#ifndef MYLISTWIDEGT_H
#define MYLISTWIDEGT_H

#include <QWidget>
#include<QListWidget>
#include<QWheelEvent>
#include <QScrollBar>

#include "config/constvariable.h"
#include"onewidget.h"


class MyListWidget : public QListWidget
{
  Q_OBJECT
public:
  explicit MyListWidget(QListWidget *parent = nullptr);

  ~MyListWidget();

  //界面布局
  void create();

  //初始化列表
  void initListWidget();

  int getIndex();

  //滚轮放缩事件
  void wheelEvent(QWheelEvent *event);

signals:
  void mySignalDoubleIndex(int msg);
  void mySignalIndex(int msg);

  void mySignalHoles(const QVector<Target_Info_Table> &data,int addr);

public slots:
  //传递子弹数据
  void passHolesData(const QMap<int,QVector<OneTaregtBullet>> &data);

  //传递电量数据
  void passBatteryData(const QVector<double> &msg);

  void passStateData(const QVector<int> &vecState);

  //显示详细信息
  void listWidgetDoubleClicked(QListWidgetItem *item);

  //添加选中阴影
  void listWidgeSelectionChanged(QListWidgetItem* item);


private:
  double screenWidth;
  double labelXY = 801;
  double currentWidth = 1;
  double scaleBody = 1;

  OneWidget *oneWidget[TargetNumber];

  QListWidgetItem *item[TargetNumber];


//  int s_index = 1;//详细信息界面序号

  int index2 = -2;

  int index3 = -3;

//  int addr = 0;



};

#endif // MYLISTWIDEGT_H
